package com.jeesite.modules.st.utils;

import com.jeesite.modules.st.config.RedisUtil;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.Console;

@Component
public class Redis0Task {
    @Resource
    private RedisUtil redisUtil;
    @Scheduled(cron = "0 0 0 * * ?")
    public void setRedis0() {//把redis数据重置为0
        BillUtil.BillType[] values = BillUtil.BillType.values();
        for (BillUtil.BillType billType : values) {
            redisUtil.set(billType.getName(), 0);
        }
    }
}
